import { apiClient2 } from "../../request/index.js"
// 保存用户个人主页数据到后台
export const saveInfoData = (requestData, headers) => {
  return apiClient2.post("/app-api/conduct/bot-platform-account/business-data-stat/report", requestData, headers)
}
// 查询粉丝是否在库
export const selectFanData = (requestData, headers) => {
  return apiClient2.get(`/app-api/conduct/fans/find-by-account?fansAccount=${requestData}`, headers)
}
//上传图片转换为oss
export const uploadImag = (requestData, headers) => {
  return apiClient2.post("/app-api/infra/file/upload-img", requestData, headers)
}
// 上传视频到oss
export const uploadVideo = (requestData, headers) => {
  return apiClient2.post("/app-api/infra/file/upload", requestData, headers)
}
// 根据账号获取任务策略
export const getTaskPolicy = (requestData, headers) => {
  return apiClient2.get(`/app-api/conduct/automation/strategy-instance/get-by-platform-account?platformAccount=${requestData.platformAccount}`, headers)
}
// 创建机器人账号
export function createRobotAccount(requestData, headers) {
  return apiClient2.post("/app-api/conduct/bot-platform-account/create", requestData, headers)
}
// 绑定机器人账号
export function bindRobotAccount(requestData, headers) {
  return apiClient2.post("/app-api/conduct/device/platform-account/bind", requestData, headers)
}
// 解绑机器人账号
export function unbindRobotAccount(requestData, headers) {
  return apiClient2.post("/app-api/conduct/device/platform-account/unbind", requestData, headers)
}
// 上传图片到oss
export function uploadImage(requestData, headers) {
  return apiClient2.post("/app-api/infra/file/upload-img", requestData, headers)
}
// 获取主播id获取素材
export function getMaterial(requestData, headers) {
  return apiClient2.get(
    `/app-api/conduct/liaozhai-host-asset-library/get-with-scene?hostId=${requestData.hostId}&accountId=${requestData.platformAccount}&scene=work&type=${requestData.type || "work"}`,
    headers
  )
}
// 处理发帖异常
export function handlePostException(requestData, headers) {
  return apiClient2.post("/app-api/conduct/liaozhai-host-asset-library/fix", requestData, headers)
}
// 判断帖子是否处理过
export function isPostCommented(requestData, headers) {
  return apiClient2.post("/app-api/conduct/recreate-post-data/is-commented", requestData, headers)
}
// 保存帖子到后台
export function savePostData(requestData, headers) {
  return apiClient2.post("/app-api/conduct/recreate-post-data/save", requestData, headers)
}
// 账号被封。发送飞书通知
export function sendFeiShuNotice(requestData, headers) {
  return apiClient2.post("/app-api/conduct/bot/report-account-abnormal", requestData, headers)
}
// 获取随机关键词
export function getRandomKeyWord(requestData, headers) {
  return apiClient2.get("/app-api/conduct/app/search-keyword-pool/list", headers)
}
// 查询粉丝是否存在
export function selectFans(requestData, headers) {
  return apiClient2.get(`/app-api/conduct/fans/find-by-account?fansAccount=${requestData.account}`, headers)
}
// 新增或更新粉丝入库
export function insertOrUpdateFans(requestData, headers) {
  return apiClient2.post("/app-api/conduct/fans/save", requestData, headers)
}
// 获取用户的聊天记录
export function getChatRecord(requestData, headers) {
  return apiClient2.get(`/app-api/conduct/conversation/getRecentConversationListByFansAccount?fansAccount=${requestData.fansAccount}&limitNum=${requestData.limitNum}`, headers)
}
// 保存聊天记录
export function saveChatRecord(requestData, headers) {
  return apiClient2.post("/app-api/conduct/conversation/saveHistoryConversations", requestData, headers)
}
// ai生成聊天类容
export function generateChatContent(requestData, headers) {
  return apiClient2.post("/app-api/conduct/edu-msg-sync/edu-chat", requestData, headers)
}
// 判断关键字和图片内容是否符合
export function checkKeyWordAndImg(requestData, headers) {
  return apiClient2.post("/app-api/conduct/ai/image-keyword-match", requestData, headers)
}
